home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1994 / MacHack 1994.toast / MacHack™94 / Talks & Papers / Timothy Knox / yerk 3.66 / Module source / vol < prev   
Text File  |  1994-06-24  |  1KB  |  44 lines

  1. \ Volume level calls
  2. \  7/26/84  CBD Version 1.0
  3. \  1/01/85  rw  FlushVol
  4. \  1/01/94    rfl    clrfcb to clear: ffcb
  5.  
  6. \ get info for default vol - leave vol name at pad
  7. : volinfo { -- fcode }
  8.     0 ffcb 22 + w!
  9.     0 ffcb 28 + w!
  10.     HFS? IF
  11.         9 ffcb +base dirfind
  12.     ELSE ffcb fcall pbgetvinfo
  13.     then ;
  14. \ ( -- #files )
  15. : filecount volinfo drop
  16.     HFS? IF ffcb 52 + w@
  17.     ELSE ffcb 40 + w@
  18.     THEN ;
  19.  
  20. \ ( file# -- b )  leave name of file at pad
  21. : Getidxfile { \ dirid -- }
  22.     fFcb 28 + w!            \ set file index
  23.     pad +base fFcb 18 + !    \ filename addr
  24.     pad 64 blanks getdirid: ffcb -> dirid
  25.     fFcb fcall PBHGetFInfo
  26.     0= IF true ELSE  false THEN
  27.     dirid setdirid: ffcb
  28.     13 pad count + 1+ c! ;
  29.  
  30. \ Print directory for current volume
  31. : Dir
  32.     0 -> curs  clear: fFcb Filecount  1+ 1
  33.     ." Directory for Volume: "
  34.     Pad count type cr
  35.     DO   I Getidxfile Pad count Type CR ?Pause LOOP
  36.     Filecount .  ."  Files." CR  1 -> curs  ;
  37.  
  38. : FlushVol
  39.     clear: fFcb
  40.     volinfo abort" GetVolInfo failed"
  41.     0 fFcb 12 + !
  42.     fFcb fcall PBFlushVol abort" FlushVol failed"
  43. ;
  44.